// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import store from './store'
import iView from 'iview'
import moment from 'moment'
import QRCode from 'qrcode'

import VueQuillEditor from 'vue-quill-editor'

import 'iview/dist/styles/iview.css'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

import VueHolder from 'vue-holderjs'

Vue.use(iView)
Vue.use(VueQuillEditor)
Vue.use(VueHolder)

Object.defineProperty(Vue.prototype, '$moment', { value: moment })
Vue.config.productionTip = false

/* eslint-disable no-new */
const vm = new Vue({
  el: '#app',
  store,
  router,
  components: { App },
  template: '<App/>'
})


router.beforeEach((to, from, next) => {
  vm.$Loading.start()
  next()
  // setTimeout(() => next(), 1000)
})

router.afterEach((to, from) => {
  vm.$Loading.finish()
})
